﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace MapLibrary.Events
{
    public class EventManager
    {

        private List<Event> events;
        private GameWorld world;

        public EventManager(GameWorld world)
        {
            this.world = world;

            events = new List<Event>();

            BuildEvents();
        }

        public void Update()
        {
            foreach (Event e in events)
            {
                e.Update();
            }
        }

        public void Draw(SpriteBatch batch)
        {
            foreach (Event e in events)
            {
                e.Draw(batch);
            }
        }

        private void BuildEvents()
        {
            events.Add(new PlayerInRegionTextEvent(world, "Use A and D To Move Left and Right", 0, 2));
            events.Add(new PlayerInRegionTextEvent(world, "Press W to Jump", 12, 14));
            events.Add(new PlayerInRegionTextEvent(world, "Press W while in the air to Jump a second time", 18, 20));
            events.Add(new PlayerInRegionTextEvent(world, "Destroy enemies by shooting with left click.\nMake sure to collect the protein!", 23, 25));
            events.Add(new PlayerInRegionTextEvent(world, "Skills are useful to handle certain germs.\nPress 1 to fire a net to trap Malaria!", 30, 33));
            events.Add(new PlayerInRegionTextEvent(world, "Enemies may be challenging to handle in groups.\nTry pressing 3 to push enemies back.", 40, 46));
            events.Add(new PlayerInRegionTextEvent(world, "Hold down SPACE in the air to glide", 50, 65));
            events.Add(new PlayerInRegionTextEvent(world, "Press 2 to activate your shield to absorb damage.\nShield will also let you ignore slow down", 66, 69));
            events.Add(new PlayerInRegionTextEvent(world, "Press E to fire your hook shot.\nJump to cancel it.", 70, 83));
            events.Add(new PlayerInRegionTextEvent(world, "You've reached the end of the tutorial!", 87, 95));
        }
    }
}
